# from selenium.webdriver.common.by import By
#
# from config.config import file_config
# from page.page_login import page_login
# from utils.file_utils import file_utils
# from utils.log_utils import logger
#
# # 读取 YAML 文件中的定位器数据
# locator_data = file_utils.read_yaml(file_config.USER_YAML)
#
#
# class page_user_management(page_login):
#     # 使用 YAML 中的数据动态设置定位器
#     user_management_loc = (getattr(By, locator_data['user_btn'][0]), locator_data['user_btn'][1])
#     user_info_loc = (getattr(By, locator_data['user_info_btn'][0]), locator_data['user_info_btn'][1])
#     add_user_loc = (getattr(By, locator_data['user_add'][0]), locator_data['user_add'][1])
#     username_loc = (getattr(By, locator_data['user_username_send'][0]), locator_data['user_username_send'][1])
#     phone_loc = (getattr(By, locator_data['user_mobile_send'][0]), locator_data['user_mobile_send'][1])
#     password_loc = (getattr(By, locator_data['user_password_send'][0]), locator_data['user_password_send'][1])
#     save_btn_loc = (getattr(By, locator_data['user_access_btn'][0]), locator_data['user_access_btn'][1])
#
#     def add_user(self, username, password, phone):
#
#         self.click(self.user_management_loc)
#         logger.info('点击用户管理')
#
#         self.click(self.user_info_loc)
#         logger.info('点击用户信息')
#
#         self.click(self.add_user_loc)
#         logger.info('点击添加用户按钮')
#
#         self.send_keys(self.username_loc, username)
#         logger.info('输入用户名')
#
#         self.send_keys(self.password_loc, password)
#         logger.info('输入密码')
#
#         self.send_keys(self.phone_loc, phone)
#         logger.info('输入电话号码')
#
#         self.click(self.save_btn_loc)
#         logger.info('单击保存按钮以添加用户')
